package com.gimi.cloud.jimi.manage.service.userInfo.Impl;

import com.gimi.cloud.jimi.dao.dao.bank.BankDao;
import com.gimi.cloud.jimi.dto.bank.BankCardDTO;
import com.gimi.cloud.jimi.entity.bank.BankCard;
import com.gimi.cloud.jimi.manage.service.userInfo.BankCardService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BankCardServiceImpl implements BankCardService {
    @Autowired
    private BankDao bankDao;

    @Override
    public BankCardDTO getUserBankCard(BankCardDTO param) {
        BankCard bankCard = bankDao.getBankByUserId(param.getUserId());
        BankCardDTO bankCardDTO = new BankCardDTO();
        if(bankCard != null) {
            BeanUtils.copyProperties(bankCard, bankCardDTO);
        }
        //bankCardDTO.setS
        return bankCardDTO;
    }
}
